<?php
class App_View_Helper_CountryListing{

	public function countryListing($operation,$tournamentid,$seriesId = "",$type = "points",$tournamentid){

		
		
		//$criteria = new Criteria();
		/*$criteria->add(TournamentPeer::ID, $seriesId)
					->add(TournamentPeer::IS_ACTIVE, 'Y');

		$tournamentTeams = Team


*/
		$c = new Criteria();
         $c->addJoin(TournamentToTeamPeer::TEAM_ID, TeamPeer::ID, Criteria::INNER_JOIN);
         $c->add(TournamentToTeamPeer::TOURNAMENT_ID, $tournamentid);
		 $oTeams = TeamPeer::doSelect($c);
		$html = "";
		foreach($oTeams as $team){

			$html .='<li><a href="javascript:void(0)" onclick="ShowPlayers('. $team->getId() .',\''. $operation .'\')"><div id="team-small-block">'. $team->getCode() .'</div></a></li>';

		}

		if($html != ""){

			$html = '<script type="text/javascript" src="'.Zend_Registry::get("baseUrl").'js/team.js"></script>
					<ul class="country-select inline">'. $html ."</ul>";
		}
		return $html;
	}

}